package com.estacionamientos

class AbstractUsuario {

	String username
	String password
	boolean enabled
	boolean accountExpired
	boolean accountLocked
	boolean passwordExpired

	static constraints = {
		username blank: false, unique: true
		password blank: false
		enabled(nullable:true)
		accountExpired(nullable:true)
		accountLocked(nullable:true)
		passwordExpired(nullable:true)
	}

	static mapping = {
		password column: '`password`'
		tablePerHierarchy false
	}

	Set<Rol> getAuthorities() {
		AbstractUsuarioRol.findAllByAbstractUsuario(this).collect { it.rol } as Set
	}
}
